class ServerMessage:
    def __init__(self, t, text):
        self.t = t
        self.text = text

class ServerMessages:
    messages = [
                ServerMessage("logged_in", _("Successfully logged in!")),
                ServerMessage("message_arrived", _("Message arrived!")),
                ServerMessage("logged_out", _("Successfully logged out!")),
                ServerMessage("not_logged_in", _("This user is not logged in!")),
                ServerMessage("wrong_mode", _("No such work mode!")),
                ServerMessage("wrong_logtype", _("No such logtype!")),
                ServerMessage("user_exist", _("User already exist! Can't register.")),
                ServerMessage("register_ok", _("Successfully registered!")),
                ServerMessage("user_not_exist", _("User not exists!")),
                ServerMessage("wrong_room_pass", _("Wrong room password. Access denied.")),
                ServerMessage("wrong_room", _("No such room.")),
                ServerMessage("entered_room", _("Entered room.")),
                ServerMessage("left_room", _("Left room.")),
                ServerMessage("created_room", _("Created room.")),
				ServerMessage("room_exist", _("Room with this name already exist.")),
				ServerMessage("already_logged_in", _("User with this name already logged in!")),
                ServerMessage("already_in_room", _("User with this name already exist in this room!"))
                ]
    
    def get(self, t):
        for a in self.messages:
            if a.t == t:
                return a
